package com.stm.web.controller.toolsTest;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.stm.common.core.controller.BaseController;
import com.stm.common.core.page.TableDataInfo;
import com.stm.framework.util.ShiroUtils;
import com.stm.toolsTest.domain.KfToolsTestApply;
import com.stm.toolsTest.service.KfToolsTestApplyService;

/**
 * 
 * @Description 试验记录结果controller
 * @CreateTime 2019年4月8日 下午5:06:09
 * @CreateBy 林龙
 */
@Controller
@RequestMapping("/toolsTest/testResult")
public class KfToolsTestResultController extends BaseController
{
    private String prefix = "toolsTest/testResult";

    @Autowired
    private KfToolsTestApplyService kfToolsTestApplyService;

    /**
     * 
     * @Description 跳转页面
     * @CreateTime 2019年4月4日 上午11:57:34
     * @CreateBy 林龙
     * @return
     */
    @RequiresPermissions("toolsTest:testResult:view")
    @GetMapping()
    public String testResult(ModelMap mmap)
    {
    	mmap.put("user", ShiroUtils.getSysUser());
        return prefix + "/testResult";
    }

    /**
     * 
     * @Description 分页查询
     * @CreateTime 2019年4月4日 上午11:57:25
     * @CreateBy 林龙
     * @param kfToolsTestApply
     * @return
     */
    @RequiresPermissions("toolsTest:testResult:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(KfToolsTestApply kfToolsTestApply)
    {
        startPage();
        List<KfToolsTestApply> list = kfToolsTestApplyService.selectAllPageList(kfToolsTestApply);
        return getDataTable(list);
    }
    
}